package com.ly.aicode.core.parse;

import com.ly.aicode.model.enums.CodeGenTypeEnum;

/**
 * @author luyi
 * @date 2025/11/8 23:58
 */
public class CodeParseExecutor {
    private static final HtmlCodeParse htmlCodeParse = new HtmlCodeParse();
    private static final MultiFileCodeParse multiFileCodeParse = new MultiFileCodeParse();

    public static Object codeParseExecute(String content, CodeGenTypeEnum typeEnum) {
        return switch (typeEnum) {
            case HTML -> htmlCodeParse.codeParse(content);
            case MULTI_FILE -> multiFileCodeParse.codeParse(content);
            default -> throw new RuntimeException("暂不支持该类型解析");
        };
    }
}
